﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NFit.Core.Interfaces;

namespace NFit.Core.IO
{
    /// <summary>
    /// Console writer for specification
    /// </summary>
    public class ConsoleSpecificationWriter : ISpecificationWriter
    {
        /// <summary>
        /// Write a specification in a stream
        /// </summary>
        /// <param name="stream">The stream to write in</param>
        /// <param name="definition">The specification to write</param>
        /// <param name="renderExecutionResult">indicate if the execution result should be written</param>
        public void Write(Stream stream, SpecificationDefinition definition, bool renderExecutionResult)
        {
            using (StreamWriter writer = new StreamWriter(stream))
            {
                writer.WriteLine(definition.Name + " " + definition.IsSuccessful);
            }
        }
    }
}
